package com.hpxx.ylzswl.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

import com.hpxx.ylzswl.base.BaseFragment;


public class HoemPagerFragmentAdapter extends FragmentPagerAdapter{


	private List<BaseFragment> fragmentList;

	public HoemPagerFragmentAdapter(FragmentManager fm) {
		super(fm);
	}

	public HoemPagerFragmentAdapter(FragmentManager fm, Context context, List<BaseFragment> fragmentList) {
		super(fm);
		this.fragmentList = fragmentList;
	}

	@Override
	public Fragment getItem(int arg0) {

		return fragmentList.get(arg0);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return fragmentList.size();
	}

	/**
	 * FragmentPagerAdapter中默认notifyDataSetChanged是无效的 
	 * 复写getItemPosition方法解决 notifyDataSetChanged无效
	 */
	@Override
	public int getItemPosition(Object object) {
		return POSITION_NONE;
	}

}
